#! /bin/php
<?php
/**
 * Base_App
 * Main entry for accessing Base_App via the cli.
 *
 * LICENSE
 *
 * This source file is subject to the new CC-GNU LGPL
 * It is available through the world-wide-web at this URL:
 * http://creativecommons.org/licenses/LGPL/2.1/
 *
 * @category   Base_App
 * @copyright  Copyright (c) 2009 Alexander fanatique* Thomas (me@alexander-thomas.net)
 * @license    http://creativecommons.org/licenses/LGPL/2.1/
 */

//We only need this class before we can start
require_once 'library/Base/App/Env.php';

//Initialize the application
Base_App_Env::initApp();

$base_app = new Base_App_Cli();

try {
	//Bootstrap the application (for cli usage)
	$base_app->setParams($argv);
	$base_app->init();

	//Run
	$base_app->run();
} catch (Base_App_Initialization_Exception $e) {
	Base_App_Debug::dd($e);	
} catch (Base_App_Cli_Exception $e) {
	Base_App_Debug::dd($e);	
} catch (Base_App_Exception $e) {
	Base_App_Debug::dd($e->getMessage());	
}

?>
